//
//  NSString+PhotoDir.m
//  HuLaQuan
//
//  Created by hok on 2/17/16.
//  Copyright © 2016 yuwubao. All rights reserved.
//

#import "NSString+PhotoDir.h"

@implementation NSString (PhotoDir)

+(NSString *)photoDir{

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString  *_photoDir=[[paths objectAtIndex:0] stringByAppendingPathComponent:@"Photoes"];
    BOOL docHas;
        
    if (![[NSFileManager defaultManager] fileExistsAtPath:_photoDir isDirectory:&docHas] ) {
        NSLog(@"no doc");
        [[NSFileManager defaultManager] createDirectoryAtPath:_photoDir withIntermediateDirectories:NO attributes:nil error:nil];
    }
    
    return _photoDir;
}
@end
